import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import '../../../components/easy_button.dart';
import '../../../routes/routes.dart';
import '../../../utils/color.dart';

class AiAppBar extends AppBar {
  static List<Widget> buildActions() => [
        EasyButton(
          '记录',
          textStyle: TextStyle(
              color: COLOR.white.withValues(alpha: 0.7), fontSize: 12.w),
          onTap: () => Get.toNamed(Routes.aiRecord),
        )
      ];

  AiAppBar(String title, {super.key, bool actions = true})
      : super(
          title: Text(
            title,
            overflow: TextOverflow.ellipsis,
          ),
          actions: actions ? buildActions() : null,
        );
}
